import { App } from 'vue'
import SvgIcon from '@/components/SvgIcon/index.vue'

const req = require.context('./svg', false, /\.svg$/)

// 全部svg路径 req.keys().map(item => req.resolve(item))

// 全部svg id req.keys().map(item => req(item))

const requireAll = (requireContent: ReturnType<typeof require.context>) => requireContent.keys().map(requireContent)

// 导入文件
requireAll(req)

export default (app: App) => {
  app.component('svg-icon', SvgIcon)
}
